package com.common.util;

import java.io.IOException;
import java.util.Properties;

/**
 * @author
 */

public class BrowserSetupConfig {
	
    /**
     * 所用浏览器类型
     */
    public static String BROWSER;
    
    /**
     * 本地ieDriver存放路径
     */
    public static String IEDIR;

    /**
     * 本地firefoxDriver存放路径
     */
    public static String FIREFOXDIR;

    /**
     * 本地chromeDriver存放路径
     */
    public static String CHROMEDIR;
    
    /**
     * 是否远程运行
     */
    public static int REMOTEORNOT;

    /**
     * 远程虚拟机IP
     */
    public static String REMOTEIP;
    
    /**
     * 远程虚拟机端口
     */
    public static int REMOTEPORT;
    
    /**
     * 远程虚拟机用户名
     */
    public static String REMOTEUSERNAME;
    
    /**
     * 远程虚拟机密码
     */
    public static String REMOTEPASSWORD;

    static {
        Properties pro = new Properties();
        try {
            pro.load(BrowserSetupConfig.class.getResourceAsStream("/properties/browser.properties"));
            BROWSER = pro.getProperty("browser");
            IEDIR = pro.getProperty("ieDir");
            FIREFOXDIR = pro.getProperty("firefoxDir");
            CHROMEDIR = pro.getProperty("chromeDir");
            REMOTEORNOT = Integer.parseInt(pro.getProperty("remoteOrNot"));
            REMOTEIP = pro.getProperty("remoteip");
            REMOTEPORT = Integer.parseInt(pro.getProperty("remoteport"));
            REMOTEUSERNAME = pro.getProperty("remoteusername");
            REMOTEPASSWORD = pro.getProperty("remotepassword");
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            System.out.println("加载浏览器配置失败");
        }
    }
}